package genericity;

//import com.sun.tools.corba.se.idl.constExpr.Or;

import java.util.ArrayList;
import java.util.List;

class Fruit {}
class Apple extends Fruit {}
class HongFuShi extends Apple {}
class Orange extends Fruit {}
class Banana extends Fruit {}

public class Test4 {

    public static void test(Class<? extends Apple> t) {
        System.out.println(t.getSimpleName());
    }

    public static void test1(Class<? super Apple> t) {
        System.out.println(t.getSimpleName());
    }

    public static void main(String[] args) {
//        int i = 0;
//        Fruit[] arr = new Apple[10];
//        arr[i ++] = new Apple();
//        arr[i ++] = new HongFuShi();
//        arr[i ++] = new Fruit();
//        arr[i ++] = new Orange();

        List<? super Fruit> list = new ArrayList<>();
        list.add(new Apple());

        test(Apple.class);
        test(HongFuShi.class);
        test1(Fruit.class);
//        test1(Banana.class);
    }
}
